Rasberry Pi 3 Wifi Access Point using Wifi Access (Configs via USB keyboard, Mouse and HDMI display) Equipment: Raspberry Pi 3B 16GB SD USB Mouse and Keyboard HDMI cable for display OS Raspbian via NOOBS v1.9.0 CAT5 connected to the internet KOOTEK Wireless-N USB Adapter(2.4 GHz, USB 2.0 High Speed, IEEE 802.11b/g/n) Make sure you change your password, update and upgrade the OS first. Install packages 1. CMD: sudo apt-get install dnsmasq hostapd *select y for yes and enter (Configured for hidden network.) 2. Configure interface to accept wifi access CMD: sudo nano /etc/network/interfaces *Edit wlan1 configs as below starting after line: wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf (for wlan0) auto wlan1 allow-hotplug wlan1 iface wlan1 inet dhcp wpa-scan-ssid 1 wpa-ap-scan 1 wpa-key-mgmt WPA-PSK wpa-proto RSN WPA wpa-pairwise CCMP TKIP wpa-group CCMP TKIP wpa-ssid “hidden SSID” wpa-psk “hidden SSID password” iface default inet dhcp *save(should have the basics on the bottom but ctrl+x, Y, enter) * shutdown and unplug you CAT5, there is probably a way to activate the ports but I like to reboot to see if there are any obvious errors. Boot shows the PI trying to connect to you network and you can check you IP via CMD: ifconfig. For here you should be able to connect to the web via your PI without the CAT5 3. Configure interface wlan0 CMD: sudo nano /etc/dhcpcd.conf *add lines to the bottom of file and save: interface wlan0 static ip_address=172.24.1.1/24 *you can shutdown the wlan0 before the next step via CMD: sudo ifdown wlan0. Was recommended in another walkthrough I found while trying to figure things out. 4. CMD: sudo nano /etc/network/interfaces (add/edit the below after “allow-hotplug wlan0”) iface wlan0 inet static address 172.24.1.1 netmask 255.255.255.0 *add “#” to comment out the next line to look like the below: # wpa-conf /etc/wpa_supplicant/wpa-supplicant.conf *save *restart dhcpcd via CMD: sudo service dhcpcd restart. Your wlan0 should now have a static IP. You can validate via CMD: ifconfig 5. Configure hostapd, create via command below CMD: sudo nano /etc/hostapd/hostapd.conf *now enter the following and save interface=wlan0 driver=nl80211 ssid=”enter what you want SSID to be” hw_mode=g channel=1 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_key_mgmt=WPA-PSK wpa_passphrase=”what you want password to be” wpa_pairwise=CCMP rsn_pairwise=CCMP *you can check how its going via command below, this should let you see your SSID as a hotspot and connect but you wont get any traffic. You will need to hit ctrl+C to stop service. CMD: sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf 6. configure hostapd to find config file on boot CMD: sudo nano /etc/default/hostapd *Find line #DEAMON_CONF=”” and remove “#” and edit to look as below: DAEMON_CONF=”/etc/hostapd/hostapd.conf” Save 7. Configure dnsmasq, but first move original and create new via command below CMD: sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig CMD: sudo nano /etc/dnsmasq.conf *now enter the below commands and save interface=wlan0 bind-interfaces server=8.8.8.8 domain-needed bogus-priv dhcp-range=172.24.1.50,172.24.1.150,12h 8. Setup ipv4 forwarding CMD: sudo nano /etc/sysctl.conf *remove “#” from line net.ipv4.ip_forward=1 and save CMD: sudo sh –c “echo 1 > /proc/sys/net/ipv4/ip_forward” 9. nat between wlan1 and wlan0 CMD: sudo iptables –t nat –A POSTROUTING –o wlan1 –j MASQUERADE CMD: sudo iptables –A FORWARD –i wlan1 –o wlan0 –m state --state RELATED,ESTABLISHED –j ACCEPT CMD: sudo iptables –A FORWARD -i wlan0 –o wlan1 –j ACCEPT * to see what the table created check via CMD’s: sudo iptables –t nat –S and sudo iptables –S CMD: sudo iptables –t nat –S(should show the below) -P PREROUTING ACCEPT -P INPUT ACCEPT -P OUTPUT ACCEPT -P POSTROUTING ACCEPT -A POSTROUTING –o wlan1 –j MASQUERADE CMD: sudo iptables –S -P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPT -A FORWARD –i wlan1 –o wlan0 –m state --state RELATED,ESTABLISHED –j ACCEPT -A FORWARD –i wlan0 –o wlan1 –j ACCEPT *now to have them applied every reboot CMD: sudo sh –c “iptables-save > /etc/iptables.ipv4.nat” *create file to get dhcpcd to run what we just created CMD: sudo nano /lib/dhcpcd/dhcpcd-hooks/70-ipv4-nat *type the below and save iptables-restore < /etc/iptables.ipv4.nat Done! Reboot and connect to your SSID.